<script type="text/javascript">
    $(function () {
        $("#bgfkjh_hbzf_toolbar a[name='hbzfdj']").click(function () {
            var win = $.window({
                title: '货币支付登记',
                width: 540,
                height: 250,
                url: '${base}/jhgl/bgfkjh/bgfkjh_hbzfcontent?gsId=${gsId!}&gysId=${gysId!}',
                buttons: [
                    {
                        text: '保存',
                        handler: function () {
                            $("#bgfkjh_hbzf_form").form("submit", {
                                onSubmit: function () {
                                    if ($("#bgfkjh_hbzf_form").form("validate")) {
                                        win.mask();
                                        return true;
                                    } else {
                                        return false;
                                    }
                                },
                                success: function (data) {
                                    win.mask("hide");
                                    var obj = eval('(' + data + ')');
                                    if (obj.statusCode == 200) {
                                        win.window("close");
                                        $("#bgfkjh_hbzf table[name='bgfkjh_hbzf_datagrid']").datagrid("reload");
                                        $.messager.show({title: '提示', msg: '保存成功'});
                                    }
                                    else {
                                        $.messager.alert("提示", obj.message, "error");
                                    }
                                }
                            })
                        }}
                ]
            });
        });
    });
</script>
<div id="bgfkjh_hbzf" style="width:100%;height:100%;">
    <input name="bmId" type="hidden" value="${bmId!}"/>
    <input name="gysId" type="hidden" value="${gysId!}"/>

    <div id="bgfkjh_hbzf_toolbar">
        <div class="PTools">
            <ul class="niu">
                <li><a href="javascript:void(0);" name="hbzfdj" plain="true">货币支付登记</a></li>
            </ul>
        </div>
    </div>
    <table name="bgfkjh_hbzf_datagrid" class="easyui-datagrid" data-options="
        url:'${base}/jhgl/bgfkjh/hbzfList?gsId=${gsId!}&gysId=${gysId!}',
        rownumbers: true,
        singleSelect: true,
        fit: true,
        fitColumns: true,
        toolbar:'#bgfkjh_hbzf_toolbar'
    ">
        <thead>
        <tr>
            <th data-options="field:'nbgs.qc',width:100">公司名称</th>
            <th data-options="field:'gys.qc',width:150">供应商</th>
            <th data-options="field:'je',width:70,formatter:function (v, r, i) {if(v>=0) return formatSl2(v, ',', '.'); else  return '<span style=color:red>'+formatSl2(v, ',', '.')+'</span>';}">
                支付金额(元)
            </th>
            <th data-options="field:'zdr.xm',width:70">制单人</th>
            <th data-options="field:'zdrq',width:70">制单日期</th>
            <th data-options="field:'bz',width:100">备注</th>
        </tr>
        </thead>
    </table>
</div>